package cuiyt.algorithm.sort;

import algorithm.utils.Integers;
import org.junit.Assert;
import org.junit.Test;

/**
 * @author cyt
 * @create 2020-08-23 18:50
 */
public class Choice {

    @Test
    public void choice1Test() {
        int[] arr = Integers.getArr(100, 10, 200);
        for (int i = 0; i < arr.length - 1; i++) {
            int max = i;
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[j] < arr[max]) {
                    max = j;
                }
            }
            int temp = arr[max];
            arr[max] = arr[i];
            arr[i] = temp;
        }
        for (int i : arr) {
            System.out.println(i);
        }
    }
}
